# encoding=utf-8
import struct
from binascii import hexlify

#device_no = 1 				# Select device before by 'pyster-admin.py showdevices'

#max_cap_length = 1024		# Max capture buffer length
#max_receive_length = 1024 	# Max receive buffer length

#stop_when_unpredicted_packet = False	# Whether stop or not when received unpredicted packet.

# Sniffing target servers
servers = {
	#'front-svr': ('xxx.xxx.xxx.xxx', 9001),	# Server name, IP and PORT
}

#
# Return packet decorator
#
# Decorator is a list as:
#   0 	Packet name
#   1 ~	Packet properties
#		  Property is a list as:
#         	('<name>', <start-offset>, <length-in-byte>, '<type>')
#		  	Available types are:
#						wstring, byte, dword
#
# Example:
#	('RequestLogin',
#			('id', 7, 64, 'wstring'),
#			('passwd', 73, 24, 'wstring'),
#		)
#
# 	Most simple decorator:
#	('RequestLoginAck',),
#
#def get_packet_decorator(data):
#	return None

#
# Return packet raw data
#
#def get_packet_raw_data(data):
#	return data
	
#
# Return packet raw data size
#
#def get_packet_raw_size(data):
#	return len(data)
	
#
# Return customized packet before sending
#
#def pre_send_callback(conn, data):
#	return data

#
# Return customized packet after receiving
#
#def handle_received_data(received):
#	return received
	
#
# Return next data packet info in merged packet
#
# Return:
#	raw_data, raw_data_size, next_packet_offset
#def get_next_sibling_packet(packet_data, packet_size, captured_size):
#	return None, 0, 0

#
# Return whether this packet size is valid one
#
#def is_valid_packet_size(size):
#	return True

